{% extends "student/student.html" %}

{% block app_content %}
<div class="container mb-4"></div>
<h1 class="display-6" align="center">所有课程</h1>
    <table class="table table-striped table-hover">
            <thead class="thead-dark">
        <tr>
            <th class="lead">课程号</th>
            <th class="lead">课程名</th>
            <th class="lead">课程学分</th>
            <th class="lead">课程学时</th>
            <th class="lead">开课学院</th>
            <th class="lead"></th>
        </tr>
            </thead>
            <tbody>
        {% if tables %}
        {% for table in tables %}
        <tr>
           <td class="lead">{{ table.CourseNum }}</td>
           <td class="lead">{{ table.CourseName }}</td>
           <td class="lead">{{ table.CourseCredit }}</td>
           <td class="lead">{{ table.CourseTime }}</td>
           <td class="lead">{{ table.CourseDept }}</td>
           {% if table.CourseNum in course_selected %}
           <td class="lead">已选</td>
           {% else %}
           <td class="lead"><a href="{{ url_for('course_teachers', CourseNum=table.CourseNum) }}" class="btn btn-outline-success btn-sm" role="button">选课</a></td>
           {% endif %}
        </tr>
        {% endfor %}
        {% endif %}
    </tbody>
    </table>
{% endblock %}